<template>
  <Dialog
    v-model="show"
    :title="status === 20003 ? t('login.前往入驻') : t('login.查看入驻信息')"
    width="450px"
    :close-on-click-modal="false"
    :hide-footer="true"
  >
    <div class="flex_fdc_aic">
      <img src="@/assets/images/login/enterIcon.png" alt="logo" class="mt10" />
      <div class="mt20">{{ status === 20003 ? t('login.暂未入驻，请前往入驻') : t('login.入驻审核中，前往查看入驻信息') }}</div>
      <div class="btn mt24 cursor-pointer" @click="handleEntry">{{ status === 20003 ? t('login.前往入驻') : t('login.查看入驻信息') }}</div>
    </div>
  </Dialog>
</template>

<script setup>
import { ref } from "vue";
import Dialog from "@/components/Dialog.vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";

const { t } = useI18n();
const router = useRouter();
const show = defineModel("show");
const props = defineProps({
  status: {
    type: Number,
    default: 20003,
  },
});

const handleEntry = () => {
  Storage.set("isEntry", 1, true);
  Storage.set("isEntryStatus", props.status, true);
  if (props.status === 20003) {
    router.push("/apply/settled_protocol");
  } else {
    router.push("/apply/open_up");
  }
};
</script>

<style scoped lang="scss">
.btn {
  width: 100%;
  color: #fff;
  border-color: #1890ff;
  background: #1890ff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px #0000000b;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 4px;
}
</style>
